<form class="form-horizontal" role="form" action="{:url('doadd')}" method="POST" 
id="paymentform">
	<div class="form-group">
		<label for="firstname" class="col-sm-2 control-label">手机号码</label>
		<div class="col-sm-6">
			<input type="text" class="form-control" id="phone" name="phone" placeholder="请输入手机号码">
		</div>
	</div>
	<div class="form-group">
		<label for="lastname" class="col-sm-2 control-label">金额</label>
		<div class="col-sm-6">
			<input type="text" class="form-control" id="amount" name="amount" placeholder="金额">
		</div>
	</div>
	<div class="form-group">
		<label for="lastname" class="col-sm-2 control-label">截止时间</label>
		<div class="col-sm-6">
			<input type="date" class="form-control" id="deadline" name="deadline" placeholder="形如2017/08/03">
		</div>
	</div>
	<div class="form-group">
		<div class="col-sm-offset-2 col-sm-6">
			<!-- <button type="submit" class="btn btn-info" onclick = "beSubmit()">提交</button> -->
			<input type="button" class="btn btn-info" onclick = "beSubmit()" value="提交">
		</div>
	</div>
</form>
<script>
	function beSubmit(){
		var phone = $('#phone').val();
		if(!phone){
			alert("请填入手机号");
			return;
		}
		$.ajax({
			url:'verify',
			data:{"phone":phone},
			async:"false",
			dataType:"json",
			type:"post",
			success:function(rel){	
				console.log(rel);
				if(rel.status==1){
				var r = confirm(rel.verify.acc_name+"身份证号"+rel.verify.cert_no+"银行卡号"+rel.verify.acc_no);
				if(r == true){
					$("#paymentform").submit();
				}	
			
				}else{
					alert("不存在该用户");
				}
			},
			error:function(){
				alert("系统错误");
			}
		});	
	}
</script>